﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace AzureForm
{
    public partial class AddQueue : Form
    {
        public AddQueue()
        {
            InitializeComponent();
        }

        public string QueueName;
        

        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            QueueName = txtQueueName.Text;
            if (QueueName.Length < 3)
            {
                MessageBox.Show("Queue Name is too short, min length is 3 characters", "Invalid Queue Name");
                txtQueueName.Focus();
            }
            else
            {
                this.DialogResult = System.Windows.Forms.DialogResult.OK;
                this.Close();
            }
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.Close();
        }

        private void txtQueueName_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == 13)
            {
                btnOK_Click(sender, e);
            }
        }

    }
}
